package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.CollectionLowestPrice;
import com.sc.nft.mapper.PropLowestPriceMapper;
import com.sc.nft.entity.PropLowestPrice;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

/**
 * (PropLowestPrice)表Dao层
 *
 * @author 王伟成
 * @since 2024-04-23 11:36:47
 */
@Slf4j
@Repository
public class PropLowestPriceDao extends ServiceImpl<PropLowestPriceMapper, PropLowestPrice> {

    public boolean exists(Long propId, BigDecimal price){
        return lambdaQuery().eq(PropLowestPrice::getPropId,propId).ge(PropLowestPrice::getLowestPrice,price).count()>0;
    }
}
